package service.impl;

import dao.NurseDao;
import entity.Nurse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.NurseService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("nurseService")
public class NurseServiceImpl implements NurseService {

    @Autowired
    private NurseDao nurseDao;

    @Override
    public List<Nurse> query(Nurse nurse, int pageSize, int pageNumber) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("nName",nurse.getnName());
        map.put("nSex",nurse.getnSex());
        map.put("nCall",nurse.getnCall());
        map.put("nEntryDate",nurse.getnEntryDate());
        map.put("offset",(pageNumber-1)*pageSize);
        map.put("limit",pageSize);
        return nurseDao.query(map);
    }
}
